home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / nt4.0 server / DRVLIB.NIC / E10P / OEMSETUP.INF < prev    next >
INI File  |  1996-07-31  |  56KB  |  1,891 lines

  1. /***********************************************************************
  2. ;
  3. ; OEMSETUP.INF  for Splash Card
  4. ;
  5. ;       Intel EtherExpress PRO/10 PCI network card and 
  6. ;       driver SETUP INF file.
  7. ;
  8. ;
  9. ;
  10. ;       This will work with:
  11. ;
  12. ;
  13. ;
  14. ;           E10 PCI 10 MB Ethernet Adapter only.
  15. ;
  16. ;-- Revision History ------------------------------
  17. ;
  18. ;  v0.10 Original version.  
  19. ;               -tmarsh 4/21/95
  20. ;  v0.12 Modified:  Changed text strings         
  21. ;               -tmarsh 4/25/95
  22. ;  v0.14 Modified:  Removed the threshold parameter        
  23. ;               -tmarsh 5/03/95
  24. ;  v1.07 Modified:  Added rename for compressed files in lists.
  25. ;               -tmarsh 5/22/95
  26. ;
  27. ;
  28. ;
  29. ;
  30. ;
  31. ;***********************************************************************
  32.  
  33. ;-----------------------------------------------------------------------
  34. ; OPTION TYPE
  35. ; -----------
  36. ; This identifies the Option type we are dealing with.  The different
  37. ; possible types are:
  38. ;
  39. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  40. ;
  41. ;  Types specific to networking:
  42. ;
  43. ; NetAdapter,        a netcard / adapter combination or just a netcard
  44. ; NetDriver,         just a netcard driver
  45. ; NetTransport,      a complete NDIS-compliant TDI transport stack
  46. ; NetService,        an NT networking service
  47. ; NetWork,           a complete network ensemble.
  48. ; NetProvider        a complete network which supports NT MPR protocol
  49. ;-----------------------------------------------------------------------
  50.  
  51. [Identification]
  52.     OptionType = NetAdapter
  53.  
  54. ;-----------------------------------------------------------------------
  55. ; PlatformsSupported
  56. ; ------------------
  57. ; This identifies the platforms supported by the adapter card.
  58. ; Possible types are:
  59. ;
  60. ; ISA, EISA and MCA
  61. ;
  62. ; For PCI the use of ISA is required. (MeThinks -TM)
  63. ;
  64. ;-----------------------------------------------------------------------
  65.  
  66. [PlatformsSupported]
  67.      EISA
  68.     ISA
  69.     "Jazz-Internal Bus"
  70.  
  71. ; EISA specified because NT needs it for EISA/PCI 
  72.  
  73. ;-----------------------------------------------------------------------
  74. ; LANGUAGES SUPPORTED
  75. ; -------------------
  76. ;
  77. ; The languages supported by the OEM INF, For every language supported
  78. ; we need to have a separate text section for every displayable text
  79. ; section.
  80. ;
  81. ;-----------------------------------------------------------------------
  82.  
  83. [LanguagesSupported]
  84.     ENG
  85.  
  86. ;-----------------------------------------------------------------------
  87. ; OPTION LIST
  88. ; -----------
  89. ; This section lists the OEM Option key names.  These keys are locale
  90. ; independent and used to represent the option in a locale independent
  91. ; manner.
  92. ;
  93. ;-----------------------------------------------------------------------
  94.  
  95. [Options]
  96.     E10PCI
  97.  
  98. ;-----------------------------------------------------------------------
  99. ; OPTION TEXT SECTION
  100. ; -------------------
  101. ; These are text strings used to identify the option to the user.  There
  102. ; are separate sections for each language supported.  The format of the
  103. ; section name is "OptionsText" concatenated with the Language represented
  104. ; by the section.
  105. ;
  106. ;-----------------------------------------------------------------------
  107.  
  108. [OptionsTextENG]
  109.     E10PCI  = "Intel EtherExpress PRO/10 PCI LAN Adapter"
  110.  
  111.  
  112. [Files-Inf]
  113. 1, oemsetup.inf, SIZE=65535, RENAME=$(!UG_Filename)
  114.  
  115.  
  116. [Files-AUX]
  117. 1,E10NT.DLL
  118. 1,E10NT.HLP
  119.  
  120.  
  121.  
  122. [Files-E10PCI]
  123. 1, E10P.SYS
  124. 1, PROKDD.SYS
  125.  
  126.  
  127. ;***********************************************************************
  128. ; CONSTANTS FOR USING DIALOGS
  129. ;***********************************************************************
  130.  
  131. [FileConstants]
  132. ;
  133. ;  File names, etc.
  134. ;
  135. UtilityInf      = "UTILITY.INF"
  136. subroutineinf   = "SUBROUTN.INF"
  137. SoftwareType    = "driver"
  138. Exit_Code       = 0
  139.  
  140. ;
  141. ; EventLog Message File
  142. ;
  143. NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
  144. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  145.  
  146. ;
  147. ; Product Info
  148. ;
  149. Manufacturer        =  "Intel"
  150. ProductMajorVersion = "3"
  151. ProductMinorVersion = "1"
  152. ProductVersion      = $(ProductMajorVersion)"."$(ProductMinorVersion)
  153.  
  154. ;
  155. ; Software
  156. ;
  157. ProductSoftwareName     = "E10"
  158. ProductSoftwareTitle    = "Intel EtherExpress PRO/10 PCI LAN Adapter Driver"
  159. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\E10P.sys"
  160. NetRuleSoftwareType     = "E10PSys ndisDriver E10Driver"
  161. NetRuleSoftwareUse      = $(SoftwareType)
  162. NetRuleSoftwareBindForm = """E10PSys"" yes no container"
  163. NetRuleSoftwareClass    = {"E10Driver basic"}
  164. NetRuleSoftwareBindable = {"E10Driver E10Adapter non exclusive 100"}
  165.  
  166. ;
  167. ; Hardware
  168. ;
  169. ProductHardwareName     = "E10"
  170. ProductHardwareTitle    = "Intel EtherExpress PRO/10 PCI Adapter"
  171. NetRuleHardwareType     = "E10 E10Adapter"
  172. NetRuleHardwareBindForm = " yes yes container"
  173. NetRuleHardwareClass    = {"E10Adapter basic"}
  174.  
  175.  
  176. ;NETCARD1_ID     = 49749             ; Un00C255
  177.  
  178. ;OEMCARD1_ID     = 134267477         ; Un0800C255
  179. ;NETCARD2_ID     = 13216416          ; SnC9AAA0
  180. ;OEMCARD2_ID     = 1305062048        ; Sn4DC9AAA0
  181. ;NETCARD3_ID     = 13216432          ; SnC9AAB0
  182. ;OEMCARD3_ID     = 1305062064        ; Sn4DC9AAB0
  183. ;NETCARD4_ID     = 13216464          ; SnC9AAD0
  184. ;OEMCARD4_ID     = 1305062096        ; Sn4DC9AAD0
  185. ;NETCARD5_ID     = 2136129           ; In209841
  186. ;OEMCARD5_ID     = 18913345          ; In01209841
  187.  
  188. ;
  189. ; Registry Key
  190. ;
  191. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  192. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  193.  
  194. [ProductType]
  195. STF_PRODUCT  = Winnt
  196. STF_PLATFORM = I386
  197.  
  198. [GeneralConstants]
  199. ;
  200. ;  Program flow control variables.
  201. ;
  202. from      = ""
  203. to        = ""
  204.  
  205. ;
  206. ;  Return codes; Exit_Code is set to one of these
  207. ;
  208. ExitCodeOk     = 0
  209. ExitCodeCancel = 1
  210. ExitCodeFatal  = 2
  211.  
  212. KeyNull            = ""
  213. MAXIMUM_ALLOWED    = 33554432
  214. RegistryErrorIndex = NO_ERROR
  215. KeyProduct         = ""
  216. KeyParameters      = ""
  217.  
  218. TRUE            = 1
  219. FALSE           = 0
  220. NoTitle         = 0
  221.  
  222. ExitState   = "Active"
  223. OldVersionExisted = $(FALSE)
  224.  
  225. DriverPath      = $(!STF_NTPATH)\drivers
  226.  
  227.  
  228.  
  229. ;***********************************************************************
  230. ; Language-Dependent Dialog Constants
  231. ;***********************************************************************
  232.  
  233. [FileConstantsENG]
  234. ;
  235. ;  Variables to support thermometer gauge and error dialogs
  236. ;
  237. ProCaption   = "Windows NT Setup"
  238. ProCancel    = "Cancel"
  239. ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  240.            "Are you sure you want to cancel copying files?"
  241.  
  242. ProCancelCap = "Network Setup Message"
  243. ProText1     = "Copying:"
  244. ProText2     = "To:"
  245.  
  246. ;
  247. ; Product Info
  248. ;
  249. FunctionTitle = "Intel EtherExpress PRO/10 PCI LAN Adapter Setup"
  250.  
  251. ;
  252. ; Software
  253. ;
  254. ProductSoftwareDescription = "Intel EtherExpress PRO/10 PCI LAN Adapter Driver"
  255.  
  256. ;
  257. ; Hardware
  258. ;
  259. ProductHardwareDescription = "Intel EtherExpress PRO/10 PCI LAN Adapter"
  260.  
  261. ;
  262. ; Dialog Message Information
  263. ;
  264. CANNOT_FIND_ANY_CARD       = "Network card is not present in the system"
  265.  
  266. [DialogConstantsENG]
  267. ;
  268. ; Common button names, etc.
  269. ;
  270. Help        = "&Help"
  271. Exit        = "Cancel"
  272. OK          = "OK"
  273. HelpContext = ""
  274. Continue    = "Continue"
  275. Cancel      = "Cancel"
  276.  
  277. [date]
  278.     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  279.     ; Minute, Second }
  280.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  281.  
  282. [Source Media Descriptions]
  283.     1  = "Intel EtherExpress PRO/10 PCI Driver Disk"  
  284.  
  285. [Signature]
  286.     FileType = MICROSOFT_DRVLIB_FILE
  287. [GetSignature]
  288.     read-syms Signature
  289.     return $(FileType)
  290.  
  291. ;-----------------------------------------------
  292. ; Input DIALOGS
  293. ;-----------------------------------------------
  294. [FileDependentDlgENG]
  295.  
  296. ;---------------------------------------------------------------------------
  297. ; 1. Identify
  298. ;
  299. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  300. ;                as we are choosing currently.
  301. ;
  302. ; INPUT:         None
  303. ;
  304. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  305. ;                $($R1): Option Type (COMPUTER ...)
  306. ;                $($R2): Diskette description
  307. ;---------------------------------------------------------------------------
  308.  
  309. [Identify]
  310.     Debug-Output "foobar 1"
  311.     read-syms Identification
  312.  
  313.     set !G:DebugOutputControl = 1
  314.  
  315.     set Status     = STATUS_SUCCESSFUL
  316.     set Identifier = $(OptionType)
  317.     set Media      = #("Source Media Descriptions", 1, 1)
  318.  
  319.     Debug-Output "OPTIONS: $(Status) $(Identifier) $(Media)"
  320.     Return $(Status) $(Identifier) $(Media)
  321.  
  322. ;------------------------------------------------------------------------
  323. ; 2. ReturnOptions:
  324. ;
  325. ; DESCRIPTION:   To return the option list supported by this INF and the
  326. ;                localised text list representing the options.
  327. ;
  328. ;
  329. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  330. ;
  331. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  332. ;                                STATUS_NOLANGUAGE
  333. ;                                STATUS_FAILED
  334. ;                                STATUS_NOTSUPPORTED
  335. ;
  336. ;                $($R1): Option List
  337. ;                $($R2): Option Text List
  338. ;------------------------------------------------------------------------
  339.  
  340. [ReturnOptions]
  341.     set Status        = STATUS_FAILED
  342.     set OptionList     = {}
  343.     set OptionTextList = {}
  344.  
  345.     ;
  346.     ; Check if the language requested is supported
  347.     ;
  348.     set LanguageList = ^(LanguagesSupported, 1)
  349.     Ifcontains(i) $($0) in $(LanguageList)
  350.     ;
  351.     ; Check if the platforms requested is supported
  352.     ;
  353.     ifstr(i) $($1) == ""
  354.         goto returnoptions
  355.     endif
  356.  
  357.     set PlatformList = ^(PlatformsSupported, 1)
  358.     Ifcontains(i) $($1) in $(PlatformList)
  359.         goto returnoptions
  360.     else
  361.         set Status = STATUS_NOTSUPPORTED
  362.         goto finish_ReturnOptions
  363.     endif
  364.     else
  365.     set Status = STATUS_NOLANGUAGE
  366.     goto finish_ReturnOptions
  367.     endif
  368.  
  369.     ;
  370.     ; form a list of all the options and another of the text representing
  371.     ;
  372. returnoptions = +
  373.     set OptionList     = ^(Options, 1)
  374. ;       set OptionList  = $(Options)
  375.     set OptionTextList = ^(OptionsText$($0), 1)
  376. ;       set OptionTextList = $(OptionsText$($0))
  377.     set Status         = STATUS_SUCCESSFUL
  378.  
  379. finish_ReturnOptions = +
  380.     Return $(Status) $(OptionList) $(OptionTextList)
  381.  
  382. ;------------------------------------------------------------------------
  383. ; InstallOption:
  384. ;
  385. ;      This section is shelled to by main installation processing
  386. ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
  387. ;
  388. ; FUNCTION:  To copy files representing Options
  389. ;            To configure the installed option
  390. ;            To update the registry for the installed option
  391. ;
  392. ; INPUT:     $($0):  Language to use
  393. ;            $($1):  OptionID to install
  394. ;            $($2):  SourceDirectory
  395. ;            $($3):  AddCopy  (YES | NO)
  396. ;            $($4):  DoCopy   (YES | NO)
  397. ;            $($5):  DoConfig (YES | NO)
  398. ;
  399. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  400. ;                            STATUS_NOLANGUAGE |
  401. ;                            STATUS_USERCANCEL |
  402. ;                            STATUS_FAILED
  403. ;------------------------------------------------------------------------
  404. [InstallOption]
  405.  
  406.     set !G:DebugOutputControl = 1
  407.     ;
  408.     ; Set default values
  409.     ;
  410.     Debug-Output "At InstallOption"
  411.     set Status   = STATUS_FAILED
  412.  
  413.     ;
  414.     ; extract parameters
  415.     ;
  416.     set Option   = $($1)
  417.     set SrcDir   = $($2)
  418.     set AddCopy  = $($3)
  419.     set DoCopy   = $($4)
  420.     set DoConfig = $($5)
  421.      Debug-Output "---------------------------------------"
  422.      Debug-Output "---->SrcDir: $(SrcDir)"
  423.      Debug-Output "---------------------------------------"
  424.     ;
  425.     ; Check if the language requested is supported
  426.     ;
  427.     set LanguageList = ^(LanguagesSupported, 1)
  428.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  429.     Return STATUS_NOLANGUAGE
  430.     endif
  431.  
  432.     set-subst LF = "\n"
  433.  
  434.     read-syms GeneralConstants
  435.     read-syms FileConstants
  436.  
  437.     read-syms DialogConstants$(!STF_LANGUAGE)
  438.     ifstr(i) $(!NTN_Origination) == "NCPA"
  439.     set Continue = "OK"
  440.     endif
  441.  
  442.     read-syms FileConstants$(!STF_LANGUAGE)
  443.  
  444.     detect date
  445.  
  446.     set-title  $(FunctionTitle)
  447.  
  448.     set to   = Begin
  449.     set from = Begin
  450.  
  451.     ;
  452.     ; Assume all is well.
  453.     ;
  454.     set CommonStatus = STATUS_SUCCESSFUL
  455.  
  456.     EndWait
  457.  
  458. ;
  459. ; Set up the operation-mode-based variables and welcome
  460. ; the user.  If the "install mode" variable is improperly set,
  461. ; assume this is a new installation.
  462. ;
  463. Begin = +
  464.     Debug-Output "At Begin"
  465.  
  466.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  467.     set StartLabel = removeadapter
  468.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  469.     set StartLabel = UpgradeSoftware
  470.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  471.     set StartLabel = bindingadapter
  472.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  473.     set StartLabel = configureadapter
  474.     ;
  475.     ; You cannot config the software component
  476.     ;
  477.     Debug-Output "Configure: ProductKeyName, NTN_RegBase="$(ProductKeyName)","$(!NTN_RegBase)
  478.  
  479.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  480.         Debug-Output "Cannot configure the E10 driver software."
  481. ;           Shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "WARNING" "Equal case"
  482.         goto setfailed
  483.     else
  484.         Debug-Output "Configuring the E10 driver software."
  485.  
  486. ;
  487. ;   This happens when the user is trying to configure the adapter.
  488. ;   We're going to allow the user to reconfigure the configurable
  489. ;   parameters: FIFO, ON, OFF, and Slot/EID
  490. ;
  491. ;   Since we've already installed the driver we have initial values for
  492. ;   these already in the registry (see the adapterverify section),
  493. ;   get the existing values and put them in the dialog as the defaults.
  494. ;
  495.         ;********************************************************
  496.         ; 1) Get the current values.
  497.  
  498.         ;    Get some handles, etc before fetching the params
  499.         ;
  500.         Ifstr $(KeyProduct) == $(KeyNull)
  501.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  502.         Ifstr $(KeyProduct) == $(KeyNull)
  503.             set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  504.             Debug-Output "Cannot find component product key"
  505.             goto fatalregistry
  506.         Endif
  507.         Endif
  508.  
  509.         ;
  510.         ; Get the other parameters;  they're attached to the service parameters key
  511.         ;
  512.         Debug-Output "INF: Shelling to FindService"
  513.  
  514.         Shell $(UtilityInf) FindService, $(KeyProduct)
  515.         Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  516.         Debug-Output "INF: FindService shell failure"
  517.         Goto ShellCodeError
  518.         Endif
  519.  
  520.         Ifstr(i) $($R0) != NO_ERROR
  521.         Debug-Output "INF: FindService Shell error: "$($R0)
  522.         Goto fatalregistry
  523.         Endif
  524.  
  525.         Set KeyParameters = $($R2)
  526.  
  527.         ;
  528.         ;  We don't need the services key, so close it.
  529.         ;
  530.         CloseRegKey $($R1)
  531.  
  532.         Ifstr $(KeyParameters) == $(KeyNull)
  533.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  534.         Debug-Output "Cannot find component service"
  535.         goto fatalregistry
  536.         Endif
  537.  
  538.         set ValueName = ""
  539.         set ValueData = ""
  540.         set ValueStr  = ""
  541.         set ValueList = {}
  542.  
  543.         ;
  544.         ; Get the old values, finally.
  545.         ;
  546.         EnumRegValue $(KeyParameters) ValueList
  547.  
  548.         ForListDo $(ValueList)
  549.         set ValueItem = $($)
  550.         set ValueName = *($(ValueItem),1)
  551.         set ValueData = *($(ValueItem),4)
  552.  
  553.         Ifstr(i) $(ValueName) == "Fifo"
  554.             set FifoValue = $(ValueData)
  555.             Debug-Output "Registry FIFO: "$(FifoValue)
  556.  
  557.         else-ifstr(i) $(ValueName) == "On"
  558.             set OnValue = $(ValueData)
  559.             Debug-Output "Registry ON: "$(OnValue)
  560.  
  561.         else-ifstr(i) $(ValueName) == "Off"
  562.             set OffValue = $(ValueData)
  563.             Debug-Output "Registry OFF: "$(OffValue)
  564.  
  565.         else-ifstr(i) $(ValueName) == "Threshold"
  566.             set ThresholdValue = $(ValueData)
  567.             Debug-Output "Registry THRESHOLD: "$(ThresholdValue)                
  568.  
  569.         else-ifstr(i) $(ValueName) == "Slot"
  570.             set SlotValue = $(ValueData)
  571.             Debug-Output "Registry SLOT: "$(SlotValue)
  572.  
  573.         else-ifstr(i) $(ValueName) == "Eid"
  574.             set NodeAddressValue = $(ValueData)
  575.             Debug-Output "Registry NodeAddress: "$(NodeAddressValue)
  576.  
  577.         else-ifstr(i) $(ValueName) == "BusTypeLocal"
  578.             set BusTypeValue = $(ValueData)
  579.             Debug-Output "Registry BusTypeLocal: "$(BusTypeValue)
  580.  
  581.         else-ifstr(i) $(ValueName) == "Connector"
  582.             set ConnectorValue = $(ValueData)
  583.             Debug-Output "Registry Connector: "$(ConnectorValue)
  584.  
  585.         else-ifstr(i) $(ValueName) == "MapRegisters"
  586.             set MapRegistersValue = $(ValueData)
  587.             Debug-Output "Registry MapRegisters: "$(MapRegistersValue)
  588.         endif
  589.         EndForListDo
  590.  
  591.         ;
  592.         ; Might have to set defaults - just in case.
  593.         ;
  594.         ifstr(i) $(FifoValue) == ""
  595.            set FifoValue = 12
  596.            Debug-Output "Setting Default FIFO"
  597.         endif
  598.  
  599.         ifstr(i) $(OnValue) == ""
  600.            set OnValue = 272
  601.            Debug-Output "Setting Default ON"
  602.         endif
  603.  
  604.         ifstr(i) $(OffValue) == ""
  605.            set OffValue = 2
  606.            Debug-Output "Setting Default OFF"
  607.         endif
  608.  
  609.         ifstr(i) $(SlotValue) == ""
  610.            set SlotValue = 0
  611.            Debug-Output "Setting Default SLOT"
  612.         endif
  613.  
  614.          ifstr(i) $(ConnectorValue) == ""
  615.            set ConnectorValue = 0
  616.            Debug-Output "Setting Default CONNECTOR"
  617.         endif
  618.  
  619.         ifstr(i) $(NodeAddressValue) == ""
  620.            set NodeAddressValue = 0
  621.            Debug-Output "Setting Default NODEADDRESS"
  622.         endif
  623.  
  624.         
  625.  
  626.         ifstr(i) $(ThresholdValue) == ""
  627.            set ThresholdValue = 16
  628.            Debug-Output "Setting Default THRESHOLD"
  629.         endif
  630.  
  631.         ifstr(i) $(MapRegistersValue) == ""
  632.            ifstr(i)     $(BusTypeValue) == "5"
  633.               set MapRegistersValue = 10
  634.            else-ifstr(i) $(BusTypeValue) == "2"
  635.               set MapRegistersValue = 32
  636.            endif
  637.            Debug-Output "Setting Default THRESHOLD"
  638.         endif
  639.  
  640.  
  641.         ;********************************************************
  642.         ; 2) At this point, we have the current registry values
  643.         ;    for the variable parameters.
  644.         ;    Now we need to open up the DLL and tell it what the
  645.         ;    the values are.
  646.  
  647.         ;
  648.         ; Load the E10NT.DLL and set the current values.
  649.         ;
  650.  
  651.             LoadLibrary "x" $(!STF_NTPATH)\E10NT.DLL MYLIBHANDLE
  652.             ;InitSlotArray
  653.             Debug-Output "made it past load library, right before initslotaray"
  654.             ;LibraryProcedure MyResult $(MYLIBHANDLE), InitSlotArray  ;, $(!STF_HWND), $(!NCPA_HANDLE)
  655.             Debug-Output "made it past initslotaray"
  656.             Debug-Output $(NETCARD_ID)
  657.             
  658.             Ifstr(i) $(BusTypeValue) == "5" 
  659.                 ;
  660.                 ;check to see if there are pci adapters in the system
  661.                 ;
  662.                 LibraryProcedure MyResult $(MYLIBHANDLE), StuffNodeAddress, $(!STF_HWND), $(!NCPA_HANDLE), $(!STF_WINDOWSSYSPATH)\drivers 
  663.                 ;
  664.                 ifstr(i) $(MyResult) == "DETECTED"   
  665.                    ;the dll detects some pci adapters
  666.                    goto ContinueConf
  667.                 endif
  668.         endif
  669.  
  670.         Debug-Output "EISA Controller Search failed! - this means none were found anywhere!!!"
  671.             Debug-Output "EISA Controller NETCARD4_ID:::  $($R1) "
  672.         set NoCard = "TRUE"
  673.             goto ContinueConf
  674.  
  675.  
  676. ContinueConf = +
  677.             ; this is a test to see if I can pass a string with all the parameters in it
  678.             ; to the dll
  679.             ;
  680.             ; first I need to put the values in a list
  681.             ; then I need to send that list to my dll
  682.             ;
  683.             ; it is for EISA {""EISABusType"",""slot"",""speed"",""threshold"",""fifo"",""on"",""off""}
  684.             ;       for PCI  {""PCIBusType"",""NodeAddress"",""speed"",""threshold"",""fifo"",""on"",""off""}
  685.  
  686.             
  687.             ifstr(i) $(BusTypeValue) == "2"
  688.                set ValueList2 = {2,$(SlotValue),$(ConnectorValue),$(ThresholdValue),$(FifoValue),$(OnValue),$(OffValue),$(MapRegistersValue)}
  689.             else-ifstr(i)  $(BusTypeValue) == "5"
  690.                set ValueList2 = {5,$(NodeAddressValue),$(ConnectorValue),$(ThresholdValue),$(FifoValue),$(OnValue),$(OffValue),$(MapRegistersValue)}
  691.             endif
  692.  
  693.             Debug-Output "VallistBefore1:  $(ValueList2)"
  694.             LibraryProcedure MyResult $(MYLIBHANDLE), SetValues, $(!STF_HWND), $(!NCPA_HANDLE), $(ValueList2)
  695.             Debug-Output "VallistBefore2:  $(ValueList2)"
  696.  
  697.  
  698.         ;
  699.         ; Now put up the dialog box and it should have the last user
  700.         ; entered values.
  701.         ;
  702. ; kroot
  703.         ; get our services subkey so the DLL know our current instance
  704.  
  705.         Debug-Output "***************** Get the instance 1 *****************"
  706.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  707.           $(MAXIMUM_ALLOWED) NetworkCardKey
  708.         Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  709.         ;
  710.         ; Get Service name
  711.         ;
  712.         GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  713.         set ServiceName = *($(ServiceNameInfo), 4)
  714.  
  715.  
  716.         CloseRegKey $(NetworkCardKey)
  717.         else
  718.         ;
  719.         ; Error, cannot open network card key
  720.         ;
  721.         Debug-Output "Unable to open NTN_RegBase: $(!NTN_RegBase)"
  722.         set ServiceName = ""
  723.         ;goto setfailed
  724.         endif
  725. ; kroot
  726.  
  727.         Debug-Output "My service name is $(ServiceName)"
  728.  
  729.  
  730. ;            LibraryProcedure MyResult $(MYLIBHANDLE), ConfigFunc, $(!STF_HWND), $(!NCPA_HANDLE), $(BusTypeValue), $(ServiceName)
  731.         LibraryProcedure MyResult $(MYLIBHANDLE), ConfigFunc, +
  732.         $(!STF_HWND), $(BusTypeValue), $(ServiceName)
  733.  
  734.             ; this is a test to see if the dll returns the right kind of string
  735.             ;LibraryProcedure ValueList2 $(MYLIBHANDLE), GetValues, $(!STF_HWND), $(!NCPA_HANDLE)
  736.             ;Debug-Output "VallistAfter:  $(ValueList2)"
  737.  
  738.  
  739.             ifstr(i) $(MyResult) == "CANCEL"
  740.                 FreeLibrary $(MYLIBHANDLE)
  741.                 goto setfailed     
  742.             endif
  743.         ifstr(i) $(MyResult) == "OK"
  744.         ;
  745.         ; If the user says it's OK, go get the new parameter values...
  746.         ;
  747.                 LibraryProcedure ValueList2 $(MYLIBHANDLE), GetValues, $(!STF_HWND), $(!NCPA_HANDLE)
  748.                 Debug-Output "VallistAfter:  $(ValueList2)"
  749.  
  750.                 ;
  751.                 ; Set the values to the returned values
  752.                 ;
  753.                 ifstr(i) $(BusTypeValue) == "2"
  754.                     set SlotValue = *($(ValueList2),2)
  755.                 else-ifstr(i) $(BusTypeValue) == "5"
  756.                     set NodeAddressValue = *($(ValueList2),2)
  757.                 endif
  758.                 set ConnectorValue = *($(ValueList2),3)
  759.                 set ThresholdValue = *($(ValueList2),4)
  760.                 set FifoValue = *($(ValueList2),5)
  761.                 set OnValue = *($(ValueList2),6)
  762.                 set OffValue = *($(ValueList2),7)                
  763.                 set MapRegistersValue = *($(ValueList2),8)                
  764.  
  765.                 Debug-Output "BusTypeLocal: $(BusTypeValue)"                         
  766.                 Debug-Output "Speed: $(ConnectorValue)"
  767.                 Debug-Output "Threshold: $(ThresholdValue)"
  768.                 Debug-Output "Fifo: $(FifoValue)"                               
  769.                 Debug-Output "On: $(OnValue)"
  770.                 Debug-Output "Off: $(OffValue)"
  771.                 Debug-Output "Threshold: $(SlotValue)"
  772.  
  773.                 Debug-Output "NodeAddress: $(NodeAddressValue)"
  774.                 
  775.  
  776.  
  777.  
  778. writeparameters1 = +
  779.  
  780.         ;
  781.         ; ...and write them to the registry.
  782.         ;
  783.         Debug-Output "At writeparameters"
  784.  
  785.         Shell $(UtilityInf), GetBusTypeNum
  786.  
  787.         set BusTypeNum = $($R1)
  788.  
  789.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  790.             Debug-Output "ShellCode error."
  791.             goto ShellCodeError
  792.         endif
  793.  
  794.         ;
  795.         ; Add the rest of the parameters to the Services area
  796.         ;
  797.            
  798.            set NewValueList = { +
  799.                        {Fifo,$(NoTitle),$(!REG_VT_DWORD),$(FifoValue)},+
  800.                        {On,$(NoTitle),$(!REG_VT_DWORD),$(OnValue)},+
  801.                        {Eid,$(NoTitle),$(!REG_VT_DWORD),$(NodeAddressValue)},+
  802.                        {Connector,$(NoTitle),$(!REG_VT_DWORD),$(ConnectorValue)},+                                     
  803.                        {MapRegisters,$(NoTitle),$(!REG_VT_DWORD),$(MapRegistersValue)},+
  804.                        {Off,$(NoTitle),$(!REG_VT_DWORD),$(OffValue)} +
  805.                       }
  806. ; !!!
  807.             Debug-Output "writeParam1: PCI NewValueList going to registry:  $(NewValueList)"
  808.           
  809.  
  810.  
  811.         Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  812.  
  813.         CloseRegKey $(KeyParameters)
  814.  
  815.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  816.             Debug-Output "ShellCode error."
  817.             goto ShellCodeError
  818.         endif
  819.  
  820.         set RegistryErrorIndex = $($R0)
  821.  
  822.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  823.             Debug-Output "Registry error: Add value list"
  824.             goto fatalregistry
  825.         endif
  826.  
  827.         endif   ; OK
  828.  
  829.         FreeLibrary $(MYLIBHANDLE)
  830.  
  831.         goto successful
  832.     endif
  833.  
  834.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  835.         Debug-Output "ShellCode error: cannot get an error string."
  836.         goto ShellCodeError
  837.     endif
  838.  
  839.     set Error = $($R0)
  840.     set from = end
  841.     set to = end
  842.     goto nonfatalinfo
  843.     else
  844.     set StartLabel = installadapter
  845.     set OEM_ABANDON_OPTIONS = {}
  846.     set OEM_ABANDON_SOFTWARE = FALSE
  847.     set OEM_ABANDON_ON = TRUE
  848.     endif
  849.  
  850.     Set from = $(fatal)
  851.     Set to = $(fatal)
  852.     Goto $(StartLabel)
  853.  
  854. ;-----------------------------------------------
  855. ; Installation Section
  856. ;-----------------------------------------------
  857.  
  858. installadapter = +
  859.     Debug-Output "At installadapter"
  860.     Debug-Output ": ProductKeyName=$(ProductKeyName), NTN_RegBase=$(!NTN_RegBase)"
  861.  
  862.     ;
  863.     ; First, check whether the same version of the software exists
  864.     ;
  865.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  866.  
  867.     Ifstr $(KeyProduct) != $(KeyNull)
  868.     ;
  869.     ; Same version already existed in the local machine
  870.     ; Popup the dialog and ask the user whether he wants to continue
  871.     ;
  872.     CloseRegKey $(KeyProduct)
  873.  
  874.     ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  875.        ;
  876.        ; Cannot Install the same software again
  877.        ;
  878.        Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle), $(ProductVersion)
  879.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  880.            Debug-Output "ShellCode error: cannot get an error string."
  881.            goto ShellCodeError
  882.        endif
  883.        goto end
  884.     else
  885.        ;
  886.        ; Add a new adapter card?
  887.        ;
  888.        set OldVersionExisted = $(TRUE)
  889.     endif
  890.     endif
  891.  
  892.     goto adapterverify
  893.  
  894. ;-----------------------------------------------
  895. ; Configuration Section
  896. ;-----------------------------------------------
  897. configureadapter = +
  898.     Debug-Output "At configureadapter"
  899.  
  900.     set Error = "Configure: Sorry, not yet implemented."
  901.     goto fatal
  902.  
  903. adapterverify = +
  904.  
  905. ; CardFound =  +
  906.  
  907.  ;   ifstr $($R0) != "NO_ERROR"
  908.  ;       ifstr $($R0) != "STATUS_SUCCESSFUL"
  909.  ;           set Error = $($R0)
  910.  ;           goto fatal
  911.  ;       endif
  912.  ;   endif
  913.  
  914.  ;   ifstr(i) $($R1) == {}
  915.  ;       set Error = $(CANNOT_FIND_ANY_CARD)
  916.  ;       set CommonStatus = STATUS_USERCANCEL
  917.  ;       set from = end
  918.  ;       goto nonfatal
  919.  ;   endif
  920.  
  921.     set NoCard = "FALSE"
  922.     set AdapterList = $($R1)
  923.  
  924.     ;
  925.     ; Add Software Component
  926.     ;
  927.     ;ifint $(OldVersionExisted) == $(FALSE)
  928.     ifstr(i) $(!NTN_InstallMode) == "install"
  929.         Ifstr(i) $(DoCopy) == "YES"
  930.  
  931.         Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  932.  
  933.         Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  934.             Goto ShellCodeError
  935.         Else-Ifstr(i) $($R0) == STATUS_FAILED
  936.             Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  937.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  938.             goto ShellCodeError
  939.             endif
  940.             set Error = $($R0)
  941.             Goto fatal
  942.         Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  943.             Goto successful
  944.         Endif
  945.  
  946.         Set SrcDir = $($R1)
  947.  
  948.         Endif
  949.  
  950.         Debug-Output "At install Install-Option"
  951.  
  952.         install "Install-Option"
  953.         ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  954.         Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  955.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  956.             goto ShellCodeError
  957.         endif
  958.         set Error = $($R0)
  959.         goto fatal
  960.         endif
  961.     endif
  962.  
  963.  
  964. ;--------------- this used to be before the copy ------------------------------
  965. ;********************
  966.     Debug-Output "At adapterverify"
  967.  
  968.     StartWait
  969.  
  970.     set DriverOnly = "FALSE"
  971.  
  972.         LibraryProcedure STATUS,$(!LIBHANDLE), CopySingleFile $(SrcDir)\e10nt.dll $(!STF_WINDOWSSYSPATH)\e10nt.dll
  973.     LibraryProcedure STATUS,$(!LIBHANDLE), CopySingleFile $(SrcDir)\e10nt.hlp $(!STF_WINDOWSSYSPATH)\e10nt.hlp
  974.     
  975.     LoadLibrary "x" $(!STF_NTPATH)\E10NT.DLL MYLIBHANDLE   
  976.     Debug-Output "made it past load library, right before initslotaray"
  977.     Debug-Output $(NETCARD_ID)
  978.  
  979.     
  980.     Ifstr(i) $(Option) == "E10PCI"
  981.        ;
  982.        ; This call should shove the node address values into the dll's global variable list
  983.        ; 
  984.                 LibraryProcedure MyResult $(MYLIBHANDLE), StuffNodeAddress, $(!STF_HWND), $(!NCPA_HANDLE), $(!STF_WINDOWSSYSPATH)\drivers 
  985.        ifstr(i) $(MyResult) == "DETECTED"   
  986.           ;the dll detects some pci adapters
  987.           goto ContinueInst
  988.        endif
  989.     endif
  990.     Debug-Output "EISA Controller Search failed! - this means none were found anywhere!!!"
  991.     Debug-Output "EISA Controller NETCARD4_ID:::  $($R1) "
  992.     set NoCard = "TRUE"
  993. ;       goto ContinueInst
  994.     goto AddDriverWithoutBoard
  995.     goto ShellCodeError
  996.  
  997. ;FreeLibrary $(MYLIBHANDLE)
  998. ;--------------- end stuff I copied -------------------------------------------
  999.  
  1000. ContinueInst = +
  1001.  
  1002.     ifint $(OldVersionExisted) == $(FALSE)
  1003.         
  1004.     Debug-Output "At AddSoftwareComponent $(OldVersionExisted) ::::: $(FALSE)"
  1005.     Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  1006.         $(ProductSoftwareName), +
  1007.         $(ProductSoftwareName), +
  1008.         $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  1009.         $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  1010.         $(NetEventDLL)
  1011.         Set OEM_ABANDON_SOFTWARE = TRUE
  1012.  
  1013.  
  1014.     
  1015.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1016.         Debug-Output "ShellCode error"
  1017.         goto ShellCodeError
  1018.     endif
  1019.  
  1020.     ;
  1021.     ;   At this point:
  1022.     ;     $R1 contains the product version key handle;
  1023.     ;     $R2 contains the NetRules subkey handle;
  1024.     ;     $R3 contains the new Services key handle; and
  1025.     ;     $R4 contains the Parameters key
  1026.     ;     $R5 contains the Linkage Key
  1027.     ;
  1028.     set RegistryErrorIndex = $($R0)
  1029.     set KeyProduct      = $($R1)
  1030.     Set SoftNetRulesKey = $($R2)
  1031.     CloseRegKey $($R3)
  1032.     CloseRegKey $($R4)
  1033.     CloseRegKey $($R5)
  1034.  
  1035.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1036.         EndWait
  1037.         Debug-Output "Registry error: add software components"
  1038.         CloseRegKey $(KeyProduct)
  1039.         CloseRegKey $(SoftNetRulesKey)
  1040.         goto fatalregistry
  1041.     endif
  1042.  
  1043.     set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  1044.                {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  1045.                {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  1046.                {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  1047.                {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  1048.                {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  1049.                {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  1050.  
  1051.     Debug-Output "At AddValueList - SoftwareType"
  1052.     Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  1053.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1054.         Debug-Output "ShellCode error."
  1055.         goto ShellCodeError
  1056.     endif
  1057.  
  1058.     set RegistryErrorIndex = $($R0)
  1059.  
  1060.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1061.         EndWait
  1062.         Debug-Output "Registry error: add value list."
  1063.         CloseRegKey $(KeyProduct)
  1064.         CloseRegKey $(SoftNetRulesKey)
  1065.         goto fatalregistry
  1066.     endif
  1067.  
  1068.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  1069.                 {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  1070.                 {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  1071.                 {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  1072.                 {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  1073.                 {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  1074.  
  1075.     Debug-Output "At AddValueList - bindform"
  1076.     Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  1077.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1078.         Debug-Output "ShellCode error."
  1079.         goto ShellCodeError
  1080.     endif
  1081.  
  1082.     set RegistryErrorIndex = $($R0)
  1083.  
  1084.     CloseRegKey $(KeyProduct)
  1085.     CloseRegKey $(SoftNetRulesKey)
  1086.  
  1087.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1088.         EndWait
  1089.         Debug-Output "Resgitry error: add value list."
  1090.         goto fatalregistry
  1091.     endif
  1092.     endif
  1093.  
  1094.     ;
  1095.     ; Create the HARDWARE\Netcard region and its corresponding service
  1096.     ;
  1097. CreateDriverEntry = +
  1098.  
  1099.     set CardInstalled = "NO"
  1100.  
  1101.     ;ForListDo $(AdapterList)
  1102.  
  1103.     ;set BusNum = *($($),1)
  1104.     ;set SlotNum = *($($),2)
  1105.     set BusNum = 0
  1106.     set SlotNum = 1
  1107.  
  1108.     ifstr(i) $(Option) == "E10PCI"
  1109.        set MapRegistersValue = "10"
  1110.        set BusTypeValue = "5"
  1111.     else-ifstr(i) $(Option) == "E10EISA"
  1112.        set MapRegistersValue = "32"
  1113.        Set BusTypeValue = "2"
  1114.     endif
  1115.  
  1116.     Debug-Output "MapRegistersValue: $(MapRegistersValue)"
  1117.  
  1118.     Debug-Output "Adding registry parameters, BusNum $(BusNum) SlotNum $(SlotNum)"
  1119.  
  1120.     ifstr $(SlotNum) != "0"
  1121.  
  1122.         ifstr $(DriverOnly) == "TRUE"
  1123.         set Retval0 = "NO_ERROR"
  1124.         set Retval1 = "NO"
  1125.         else
  1126. ;               Shell $(UtilityInf), IsNetCardAlreadyInstalled, $(BusNum), +
  1127.         Shell "", IsE10CardAlreadyInstalled, $(BusNum), +
  1128.             $(SlotNum), $(ProductHardwareDescription), $(ProductHardwareName)
  1129.         set Retval0 = $($R0)
  1130.         set Retval1 = $($R1)
  1131.         endif
  1132.  
  1133.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1134.         goto ShellCodeError
  1135.         endif
  1136.  
  1137.         ifstr $(Retval0) != "NO_ERROR"
  1138.         set Error = $($R0)
  1139.         goto fatal
  1140.         endif
  1141.  
  1142.  
  1143.         ifstr(i) $(Retval1) != "YES"
  1144.  
  1145.         Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  1146.  
  1147.         ifint $($R4) != -1
  1148.             Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  1149.         endif
  1150.  
  1151.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1152.             goto ShellCodeError
  1153.         endif
  1154.  
  1155.         set RegistryErrorIndex = $($R0)
  1156.  
  1157.         Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  1158.             EndWait
  1159.             CloseRegKey $($R1)
  1160.             CloseRegKey $($R2)
  1161.             CloseRegKey $($R3)
  1162.             goto fatalregistry
  1163.         endif
  1164.  
  1165.         ;
  1166.         ;   At this point:
  1167.         ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
  1168.         ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  1169.         ;     $R3  Registry key handle for <service>\Parameters key
  1170.         ;     $R4  Adapter number assigned to adapter
  1171.         ;     $R5  Service name generated by combining svc name with adapter number
  1172.         ;
  1173.         Set HardNetCardKey      = $($R1)
  1174.         Set HardNetRuleKey      = $($R2)
  1175.         Set HardParameterKey    = $($R3)
  1176.         set AdapterNumber       = $($R4)
  1177.  
  1178.         set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  1179.                    {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)},+
  1180.                    {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  1181.                    {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  1182.                    {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  1183.                    {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  1184.  
  1185.         Shell  $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
  1186.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1187.             goto ShellCodeError
  1188.         endif
  1189.  
  1190. ; kroot
  1191.         ; get our services subkey so the DLL know our current instance
  1192.  
  1193.         Debug-Output "***************** Get the instance 2 *****************"
  1194.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  1195.           $(MAXIMUM_ALLOWED) NetworkCardKey
  1196.         Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  1197.         ;
  1198.         ; Get Service name
  1199.         ;
  1200.         GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  1201.         set ServiceName = *($(ServiceNameInfo), 4)
  1202.  
  1203.  
  1204.         CloseRegKey $(NetworkCardKey)
  1205.         else
  1206.         ;
  1207.         ; Error, cannot open network card key
  1208.         ;
  1209.         Debug-Output "Unable to open NTN_RegBase: $(!NTN_RegBase)"
  1210.         set ServiceName = ""
  1211.  
  1212.         ;goto setfailed
  1213.         endif
  1214. ; kroot
  1215.  
  1216.         Debug-Output "My service name is $(ServiceName)"
  1217.         ;
  1218.         ; Put up the dialog box and allow the user to configure
  1219.         ; FIFO, ON, OFF parameters.  We have found the board in a
  1220.         ; particular slot so we won't allow them to alter the slot
  1221.         ; parameter yet.
  1222.         ;
  1223.         
  1224.         ifstr(i) $(Option) == "E10EISA"
  1225.            LibraryProcedure MyResult $(MYLIBHANDLE), ConfigFunc, +
  1226.             $(!STF_HWND), 2, $(ServiceName)
  1227.         else-ifstr(i) $(Option) == "E10PCI"
  1228.            LibraryProcedure MyResult $(MYLIBHANDLE), ConfigFunc, +
  1229.             $(!STF_HWND), 5, $(ServiceName)
  1230.         endif
  1231.         ;*--- this is if the user cancelled from the dialog box ---*
  1232.         ifstr(i) $(MyResult) == "CANCEL"
  1233.             goto setfailed     
  1234.         endif
  1235.  
  1236.         ; I want the thing after the if to get the values from the dll
  1237.         ifstr(i) $(MyResult) == "OK"
  1238.                     ;
  1239.             ; If the user says it's OK, go get the new parameter values...
  1240.             ;
  1241.  
  1242.                     LibraryProcedure ValueList2 $(MYLIBHANDLE), GetValues, $(!STF_HWND), $(!NCPA_HANDLE)
  1243.                     Debug-Output "VallistAfter:  $(ValueList2)"
  1244.  
  1245.                     ;
  1246.                     ; Set the values to the returned values
  1247.                     ;
  1248.                     ifstr(i) $(Option) == "E10EISA"
  1249.                         set SlotValue = *($(ValueList2),2)
  1250.                     else-ifstr(i) $(Option) == "E10PCI"
  1251.                         set NodeAddressValue = *($(ValueList2),2)
  1252.                         Debug-Output "NodeAddr returned to inf:  $(NodeAddressValue)"
  1253.                     endif
  1254.                     set ConnectorValue = *($(ValueList2),3)
  1255.                     set ThresholdValue = *($(ValueList2),4)
  1256.                     set FifoValue = *($(ValueList2),5)
  1257.                     set OnValue = *($(ValueList2),6)
  1258.                     set OffValue = *($(ValueList2),7)                                    
  1259.                     set MapRegistersValue = *($(ValueList2),8)                
  1260.                     ifstr(i) $(ConnectorValue) == "Auto Detect"
  1261.                        set ConnectorValue = 0
  1262.                     endif
  1263.                     
  1264.         endif
  1265.  
  1266.                 Debug-Output "Slot: $(SlotValue)"                               
  1267.                 Debug-Output "BusTypeLocal: $(BusTypeValue)"                         
  1268.                 Debug-Output "Speed: $(ConnectorValue)"
  1269.                 Debug-Output "Threshold: $(ThresholdValue)"
  1270.                 Debug-Output "Fifo: $(FifoValue)"                               
  1271.                 Debug-Output "On: $(OnValue)"
  1272.                 Debug-Output "Off: $(OffValue)"                         
  1273.                 Debug-Output "MapRegisters: $(MapRegistersValue)"
  1274.  
  1275.                 Debug-Output "NodeAddress: $(NodeAddressValue)"
  1276.  
  1277.  
  1278.         FreeLibrary $(MYLIBHANDLE)
  1279.  
  1280.         set CardInstalled = "YES"
  1281.  
  1282.         
  1283.         
  1284.         
  1285.         ; ------------- if it is pci -------------------------------------------
  1286.         
  1287.         set NewValueList = {{BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeValue)},+
  1288.                             {BusTypeLocal,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeValue)},+
  1289.                             {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+             
  1290.                             {Fifo,$(NoTitle),$(!REG_VT_DWORD),$(FifoValue)},+
  1291.                             {On,$(NoTitle),$(!REG_VT_DWORD),$(OnValue)},+    
  1292.                             {BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNum)},+                                                             
  1293.                             {Off,$(NoTitle),$(!REG_VT_DWORD),$(OffValue)},+                         
  1294.                             {Connector,$(NoTitle),$(!REG_VT_DWORD),$(ConnectorValue)},+                                                             
  1295.                             {MapRegisters,$(NoTitle),$(!REG_VT_DWORD),$(MapRegistersValue)},+                                                                                                                       
  1296.                         {Eid,$(NoTitle),$(!REG_VT_DWORD),$(NodeAddressValue)}+                 
  1297.                    }
  1298. ; !!!
  1299.             Debug-Output "writeParam2: PCI NewValueList going to registry:  $(NewValueList)"
  1300.         
  1301.         Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
  1302.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1303.             goto ShellCodeError
  1304.         endif
  1305.  
  1306.         
  1307.  
  1308.         set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  1309.         set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  1310.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  1311.                     {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  1312.                     {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  1313.                     {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)} }
  1314.         Shell  $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
  1315.  
  1316.         CloseRegKey $(HardNetCardKey)
  1317.         CloseRegKey $(HardNetRuleKey)
  1318.         CloseRegKey $(HardParameterKey)
  1319.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1320.             goto ShellCodeError
  1321.         endif
  1322.         endif
  1323.     endif
  1324.  
  1325.     ifstr $(DriverOnly) == "TRUE"
  1326.         goto writeparameters2
  1327.     endif
  1328.     ;EndForListDo
  1329.  
  1330.     ;
  1331.     ; If no cards were installed, it means that either there were no cards
  1332.     ; found (NoCard = TRUE) or all cards in the system have already had
  1333.     ; drivers installed for them (CardInstalled = NO).
  1334.     ;
  1335.     ; What we want to do here is allow the user to install the driver for
  1336.     ; a board that is not yet in the system.  This way the user can get the
  1337.     ; driver installed, shutdown NT, install the adapter and reboot.
  1338.     ; If we don't let the user install a driver for a non-existent board,
  1339.     ; then he has to shutdown NT, install the board, reboot, install the
  1340.     ; driver, shutdown and then reboot again - what a pain.
  1341.     ;
  1342. AddDriverWithoutBoard =  +
  1343.     ifstr $(NoCard) == "TRUE"
  1344. ;        Shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "WARNING" "No adapter found.  Install driver anyway?"
  1345. ;        ifstr(i) $($R1) == "OK"
  1346.         ;
  1347.         ; NOTE: this will only work for E10 boards
  1348.         ;
  1349.         set EisaId = "1611715621"
  1350.             
  1351.         set AdapterList = {{"0", "10", "269538341"}}
  1352.         set DriverOnly = "TRUE"
  1353.         set NoCard = "FALSE"
  1354.         goto ContinueInst
  1355. ;        endif
  1356.     endif
  1357.  
  1358.  
  1359.     ifstr $(CardInstalled) == "NO"
  1360. ; kroot!!!
  1361. ; This message happens when it shouldn't
  1362.     Shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "Got that bogus message again. Show Ken how you got here!"
  1363.  
  1364. ;        Shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "WARNING" "Drivers are already installed for the current hardware.  Install driver anyway?"
  1365. ;        ifstr(i) $($R1) == "OK"
  1366.         ;
  1367.         ; NOTE: this will only work for E10 boards
  1368.         ;
  1369.         set EisaId = "1611715621" ;  fl32 will have to change if installed
  1370.     
  1371.         set AdapterList = {{"0", "10", "269538341"}}
  1372.         set DriverOnly = "TRUE"
  1373.         goto ContinueInst
  1374. ;        endif
  1375.     endif
  1376.  
  1377. ;
  1378. ; REQUIRED:   $(KeyParameters) contains service Parameters key handle
  1379. ;
  1380. writeparameters2 = +
  1381.     Debug-Output "At writeparameters"
  1382.     EndWait
  1383.     goto successful
  1384.  
  1385. ;-----------------------------------------------
  1386. ; Binding section
  1387. ;-----------------------------------------------
  1388. bindingadapter =+
  1389.     Debug-Output "At bindingadapter"
  1390.     set Error = "Binding: Sorry, not yet implemented."
  1391.     goto fatal
  1392.  
  1393. ;-----------------------------------------------
  1394. ; Removeadapter section
  1395. ;-----------------------------------------------
  1396.  
  1397. removeadapter = +
  1398.     Debug-Output "At removeadapter"
  1399.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  1400.     ;
  1401.     ; Remove Software Component
  1402.     ;
  1403.     Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1404.         $(ProductSoftwareName)
  1405.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1406.         Debug-Output "ShellCode error"
  1407.         goto ShellCodeError
  1408.     endif
  1409.  
  1410.     set RegistryErrorIndex = $($R0)
  1411.  
  1412.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1413.         goto fatalregistry
  1414.     endif
  1415.     else
  1416.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1417.         $(ProductSoftwareName), $(!NTN_RegBase)
  1418.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1419.         Debug-Output "ShellCode error"
  1420.         goto ShellCodeError
  1421.     endif
  1422.  
  1423.     set RegistryErrorIndex = $($R0)
  1424.  
  1425.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1426.         goto fatalregistry
  1427.     endif
  1428.     endif
  1429.     ; look to see if it can be removed
  1430.     Debug-Output "Before call to InfLookup"
  1431.  
  1432.     LoadLibrary "x" $(!STF_NTPATH)\E10NT.DLL MYLIBHANDLE
  1433.     LibraryProcedure MyResult $(MYLIBHANDLE), SharedInfSearch, $(!STF_HWND), $(!NCPA_HANDLE), $(STF_CONTEXTINFNAME)    
  1434.     FreeLibrary $(MYLIBHANDLE)
  1435.     Debug-Output "MyResult: $(MyResult)"
  1436.  
  1437.     Debug-Output "After call to InfLookup"
  1438.  
  1439.     ifstr(i) $(MyResult) != "FOUND_SOME"
  1440.        ; delete it from the registry
  1441.        set RegInfFileNameKey = "SYSTEM\Setup\InfOptions"
  1442.        OpenRegKey $(!REG_H_LOCAL) "" $(RegInfFileNameKey) $(MAXIMUM_ALLOWED) ProductKey
  1443.        Ifstr $(ProductKey) == $(KeyNull)
  1444.       Debug-Output "OEMSETUP.INF: could not open Software product key"          
  1445.        endif
  1446.        DeleteRegTree $(ProductKey) $(MyResult)
  1447.        CloseRegKey $(ProductKey)
  1448.  
  1449.        ;delete it from the disk
  1450.        Debug-Output "nuking STF_CONTEXTINFNAME="$(STF_CONTEXTINFNAME)
  1451.        LoadLibrary "x" $(!STF_CWDDIR)\setupdll.dll !LIBHANDLE
  1452.        LibraryProcedure Status1, $(!LIBHANDLE), DelFile, $(STF_CONTEXTINFNAME)
  1453.        FreeLibrary $(!LIBHANDLE)
  1454.     endif
  1455.     goto end
  1456.  
  1457. ;-----------------------------------------------
  1458. ; Upgrade Software section
  1459. ;-----------------------------------------------
  1460.  
  1461. UpgradeSoftware = +
  1462.     Debug-Output "At UpgradeSoftware"
  1463.     ;
  1464.     ; First determine whether we want to do upgrade or update for software
  1465.     ; or hardware component. Then we will determine whether the Mode is
  1466.     ; update or upgrade.
  1467.     ;
  1468.     ; If the same version of the product existed in the registry, we do
  1469.     ; update. Otherwise, we will do an upgrade.
  1470.     ;
  1471.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  1472.     ; Upgrade software component
  1473.     ;
  1474.     ; see whether the same version exist or not
  1475.     ;
  1476.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  1477.  
  1478.     Ifstr $(KeyProduct) != $(KeyNull)
  1479.         GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  1480.         set Version = *($(VersionInfo), 4)
  1481.  
  1482.         ;
  1483.         ; Update the binaries
  1484.         ;
  1485.         Split-String $(!NTN_Infname), "\", FilenameList
  1486.         QueryListSize ListSize $(FilenameList)
  1487.         set !UG_Filename = *($(FilenameList), $(ListSize))
  1488.  
  1489.         install "Install-Update"
  1490.         ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  1491.         goto fatal
  1492.         endif
  1493.  
  1494.         ; Upgrade the version number
  1495.         ;
  1496.         SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  1497.         SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  1498.  
  1499.         ;
  1500.         ; do nothing for update
  1501.         ;
  1502.         ifint $(Version) != $(ProductVersion)
  1503.            ;
  1504.            ; If the major version number is not the same,
  1505.            ; it is major upgrade. So let's Upgrade the product
  1506.            ;
  1507.            ; make other upgrade change if necessary
  1508.            ;
  1509.         endif
  1510.         CloseRegKey $(KeyProduct)
  1511.     else
  1512.         ;
  1513.         ; Cannot Open software key, goto ERROR
  1514.         ;
  1515.         goto fatalregistry
  1516.     endif
  1517.     else
  1518.     ;
  1519.     ; upgrade/update hardware component
  1520.     ; There is no different between upgrade and update for hardware
  1521.     ; component
  1522.     ;
  1523.     ; 1. Get the Service Name
  1524.     ; 2. Change the NetRule section if necessary
  1525.     ;
  1526.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  1527.           $(MAXIMUM_ALLOWED) NetworkCardKey
  1528.     Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  1529.         ;
  1530.         ; Get Service name
  1531.         ;
  1532.         GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  1533.         set ServiceName = *($(ServiceNameInfo), 4)
  1534.  
  1535.         ;
  1536.         ; Change the NetRule if necessary
  1537.         ;
  1538.         OpenRegKey $(NetworkCardKey) "" "NetRules" +
  1539.         $(MAXIMUM_ALLOWED) NetRuleKey
  1540.         Ifstr(i) $(NetRuleKey) != $(KeyNull)
  1541.         ;
  1542.         ; Make the change....
  1543.         ;
  1544.         else
  1545.         ;
  1546.         ; Error, cannot open net rules key
  1547.         ;
  1548.         goto fatalregistry
  1549.         endif
  1550.  
  1551.         CloseRegKey $(NetRules)
  1552.         CloseRegKey $(NetworkCardKey)
  1553.     else
  1554.         ;
  1555.         ; Error, cannot open network card key
  1556.         ;
  1557.         goto fatalregistry
  1558.     endif
  1559.     ;
  1560.     ; 3. Change the service section of the hardware. i.e.,
  1561.     ;    ParameterName change, value change, etc.
  1562.     ;
  1563.     OpenRegKey $(!REG_H_LOCAL) "" +
  1564.           $(!NTN_ServiceBase)"\"$(ServiceName) +
  1565.           $(MAXIMUM_ALLOWED) ServiceKey
  1566.  
  1567.     Ifstr(i) $(ServiceKey) != $(KeyNull)
  1568.         ;
  1569.         ; Get the ServiceKey to change the Start value
  1570.         ; or Type value. Or open Parameters key to
  1571.         ; change the hardware parameters if necessary.
  1572.         ;
  1573.         CloseRegKey $(ServiceKey)
  1574.     else
  1575.         ;
  1576.         ; Error, cannot open network card key
  1577.         ;
  1578.         goto fatalregistry
  1579.     endif
  1580.     endif
  1581.  
  1582.     goto end
  1583.     ;
  1584.     ; End of Upgrade Software
  1585.     ;
  1586.  
  1587. ;
  1588. ;  Escape hatches
  1589. ;
  1590. successful = +
  1591.     Debug-Output "At successful"
  1592.     goto end
  1593.  
  1594. abandon = +
  1595.     Debug-Output "At abandon"
  1596.     ForListDo $(OEM_ABANDON_OPTIONS)
  1597.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1598.         $(ProductSoftwareName), $($)
  1599.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1600.         Debug-Output "ShellCode error"
  1601.         goto ShellCodeError
  1602.     endif
  1603.  
  1604.     set RegistryErrorIndex = $($R0)
  1605.  
  1606.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1607.         goto fatalregistry
  1608.     endif
  1609.     EndForListDo
  1610.  
  1611.     ; remove the inf file here
  1612.     ; look to see if it can be removed
  1613.     Debug-Output "Before call to InfLookup"
  1614.  
  1615.     LoadLibrary "x" $(!STF_NTPATH)\E10NT.DLL MYLIBHANDLE
  1616.     LibraryProcedure MyResult $(MYLIBHANDLE), SharedInfSearch, $(!STF_HWND), $(!NCPA_HANDLE), $(STF_CONTEXTINFNAME)    
  1617.     FreeLibrary $(MYLIBHANDLE)
  1618.     Debug-Output "MyResult: $(MyResult)"
  1619.  
  1620.     Debug-Output "After call to InfLookup"
  1621.  
  1622.     ;               
  1623.     ifstr(i) $(MyResult) != "FOUND_SOME"
  1624.        ; delete it from the registry
  1625.        set RegInfFileNameKey = "SYSTEM\Setup\InfOptions"
  1626.        OpenRegKey $(!REG_H_LOCAL) "" $(RegInfFileNameKey) $(MAXIMUM_ALLOWED) ProductKey
  1627.        Ifstr $(ProductKey) == $(KeyNull)
  1628.       Debug-Output "OEMSETUP.INF: could not open Software product key"          
  1629.        endif
  1630.        DeleteRegTree $(ProductKey) $(MyResult)
  1631.        CloseRegKey $(ProductKey)
  1632.  
  1633.        ; delete it from the disk
  1634.        Debug-Output "nuking STF_CONTEXTINFNAME="$(STF_CONTEXTINFNAME)
  1635.        LoadLibrary "x" $(!STF_CWDDIR)\setupdll.dll !LIBHANDLE
  1636.        LibraryProcedure Status1, $(!LIBHANDLE), DelFile, $(STF_CONTEXTINFNAME)
  1637.        FreeLibrary $(!LIBHANDLE)
  1638.     endif
  1639.  
  1640.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  1641.     ; Remove Software Component
  1642.     Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1643.         $(ProductSoftwareName), FALSE
  1644.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1645.         Debug-Output "ShellCode error"
  1646.         goto ShellCodeError
  1647.     endif
  1648.  
  1649.     set RegistryErrorIndex = $($R0)
  1650.  
  1651.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1652.         goto fatalregistry
  1653.     endif
  1654.     endif
  1655.  
  1656.     goto end
  1657.  
  1658. ;
  1659. ; warning display
  1660. ;
  1661. warning = +
  1662.     Debug-Output "At warning"
  1663.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1664.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1665.     goto ShellCodeError
  1666.     endif
  1667.     ifstr(i) $($R1) == "OK"
  1668.     goto $(to)
  1669.     else-ifstr(i) $($R1) == "CANCEL"
  1670.     goto $(from)
  1671.     else
  1672.     goto "end"
  1673.     endif
  1674. ;
  1675. ; non fatal error display
  1676. ;
  1677. nonfatalinfo = +
  1678.     Debug-Output "At nonfatalinfo"
  1679.     Set Severity = STATUS
  1680.     Set CommonStatus = STATUS_USERCANCEL
  1681.     goto nonfatalmsg
  1682.  
  1683. nonfatal = +
  1684.     Debug-Output "At nonfatal"
  1685.     Set Severity = NONFATAL
  1686.     goto nonfatalmsg
  1687.  
  1688. nonfatalmsg = +
  1689.     Debug-Output "At nonfatalmsg"
  1690.     ifstr(i) $(Error) == ""
  1691.     Set Severity = NONFATAL
  1692.     Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1693.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1694.         goto ShellCodeError
  1695.     endif
  1696.     set Error = $($R0)
  1697.     endif
  1698.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1699.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1700.     goto ShellCodeError
  1701.     endif
  1702.     ifstr(i) $($R1) == "OK"
  1703.     goto $(from)
  1704.     else
  1705.     goto "end"
  1706.     endif
  1707.  
  1708. ;
  1709. ;  Registry is broken
  1710. ;
  1711. fatalregistry = +
  1712.     Debug-Output "At fatalregistry"
  1713.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1714.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1715.     goto ShellCodeError
  1716.     endif
  1717.     set Error = $($R0)
  1718.     goto fatal
  1719. ;
  1720. ; fatal error display
  1721. ;
  1722. fatal = +
  1723.     Debug-Output "At fatal"
  1724.     ifstr(i) $(Error) == ""
  1725.     Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1726.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1727.         goto ShellCodeError
  1728.     endif
  1729.     set Error = $($R0)
  1730.     endif
  1731.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1732.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1733.     goto ShellCodeError
  1734.     endif
  1735.  
  1736.     goto setfailed
  1737.  
  1738. ;
  1739. ;  Shelling error
  1740. ;
  1741. ShellCodeError = +
  1742.     Debug-Output "At ShellCodeError"
  1743.     set DlgType      = "MessageBox"
  1744.     set STF_MB_TITLE = "Error: "$(FunctionTitle)
  1745.     set STF_MB_TEXT  = "Shell Code Error"
  1746.     set STF_MB_TYPE  = 1
  1747.     set STF_MB_ICON  = 3
  1748.     set STF_MB_DEF   = 1
  1749.     ui start "Error Message"
  1750.     goto setfailed
  1751.  
  1752. setfailed = +
  1753.     Debug-Output "At setfailed"
  1754.     set CommonStatus = STATUS_FAILED
  1755.     ;
  1756.     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1757.     ;
  1758.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1759.     set OEM_ABANDON_ON = FALSE
  1760.     goto abandon
  1761.     endif
  1762.     goto end
  1763.  
  1764. end = +
  1765.     Debug-Output "At end"
  1766.     goto term
  1767.  
  1768. term = +
  1769.     Debug-Output "At term"
  1770.     Return $(CommonStatus)
  1771.  
  1772.  
  1773. [DebugConfiguration]
  1774.     return
  1775.  
  1776.  
  1777. ;***************************************************************
  1778. ;  INSTALL SECTIONS
  1779. ;***************************************************************
  1780. [Install-Option]
  1781.     Debug-Output "At Install-Option"
  1782.     set STF_VITAL = ""
  1783.  
  1784.     ifstr(i) $(AddCopy) == "YES"
  1785.  
  1786.     Debug-Output "AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers"
  1787.  
  1788.     ;
  1789.     ; Add the files to the copy list
  1790.     ;
  1791.     ;  BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  1792.     ;      the other INF files
  1793.     ;
  1794.     AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1795.         AddSectionFilesToCopyList Files-AUX $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1796.  
  1797.     endif
  1798.  
  1799.     ifstr(i) $(DoCopy) == "YES"
  1800.  
  1801.        Debug-Output "CopyFilesInCopyList"
  1802.  
  1803.        ;
  1804.        ; Copy files in the copy list
  1805.        ;
  1806.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1807.        CopyFilesInCopyList
  1808.  
  1809.     endif
  1810.  
  1811.     Exit
  1812.  
  1813. [Install-Update]
  1814.     Debug-Output "At Install-Update"
  1815.    set STF_VITAL        = ""
  1816.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1817.    ;set STF_VERSION     = "YES"
  1818.  
  1819.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1820.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1821.  
  1822.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1823.    CopyFilesInCopyList
  1824.  
  1825.    exit
  1826.  
  1827.  
  1828. [IsE10CardAlreadyInstalled]
  1829.     read-syms InitBaseVars
  1830.     set AlreadyExisted  = "NO"
  1831.     set BusNum  = $($0)
  1832.     set SlotNum = $($1)
  1833.     set Description = $($2)
  1834.     set Product = $($3)
  1835.     OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardKeyName) $(MAXIMUM_ALLOWED) IE_KeyNetcards
  1836.     Ifstr $(IE_KeyNetcards) == $(KeyNull)
  1837.        set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
  1838.        goto IE_Return
  1839.     endif
  1840.     EnumRegKey $(IE_KeyNetcards) IE_KeyNameList
  1841.     ForListDo  $(IE_KeyNameList)
  1842.     set IE_KeyName = *($($),1)
  1843.     OpenRegKey $(IE_KeyNetcards) "" $(IE_KeyName) $(MAXIMUM_ALLOWED) IE_Card
  1844.     Ifstr $(IE_Card) == $(KeyNull)
  1845.        set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
  1846.        goto IE_Return
  1847.     endif
  1848.     GetRegValue $(IE_Card),"Description", DescriptionInfo
  1849.     GetRegValue $(IE_Card),"ProductName", ProductNameInfo
  1850.     set CardDescription     = *($(DescriptionInfo), 4)
  1851.     set CardProductName     = *($(ProductNameInfo), 4)
  1852.     ifstr(i) $(CardDescription) == $(Description)
  1853.         ifstr(i) $(CardProductName) == $(Product)
  1854.         GetRegValue $(IE_Card), "ServiceName", ServiceNameInfo
  1855.         set ServiceName = *($(ServiceNameInfo), 4)
  1856.         OpenRegKey $(!REG_H_LOCAL) "" +
  1857.            $(ServicesBaseName)"\"$(ServiceName)"\Parameters" +
  1858.            $(MAXIMUM_ALLOWED) IE_KeyService
  1859.         Ifstr $(IE_KeyService) == $(KeyNull)
  1860.            set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
  1861.            goto IE_Return
  1862.         endif
  1863.         GetRegValue $(IE_KeyService), "BusNumber", BusInfo
  1864.         GetRegValue $(IE_KeyService), "Slot", SlotInfo
  1865.         set CardBusNum = *($(BusInfo), 4)
  1866.         set CardSlotNum = *($(SlotInfo), 4)
  1867.         ifint $(CardBusNum) == $(BusNum)
  1868.             ifint $(CardSlotNum) == $(SlotNum)
  1869.             set AlreadyExisted = "YES"
  1870.             endif
  1871.         endif
  1872.         endif
  1873.     endif
  1874.     EndForListDo
  1875. IE_Return = +
  1876.     return $(RegistryErrorIndex) $(AlreadyExisted)
  1877.  
  1878. [InitBaseVars]
  1879. KeyNull            = ""
  1880. MAXIMUM_ALLOWED    = 33554432
  1881. KeyInfo            = {}
  1882. RegistryErrorIndex = NO_ERROR
  1883. NoTitle            = 0
  1884. CurrentControlSet  = "SYSTEM\CurrentControlSet"
  1885. ServicesBaseName   = $(CurrentControlSet)"\Services"
  1886. NetworkCardKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"
  1887. !RegLastError      = NO_ERROR
  1888. [RegistryErrorSetup]
  1889. RegistryErrorIndex = ^(RegistryErrors$(!STF_LANGUAGE),1)
  1890. RegistryErrorList = ^(RegistryErrors$(!STF_LANGUAGE),2)
  1891.